/* Compressed with CompressRexx v3.0 (CMPMODE HEAVY), (C) 1993-96 Robert Hofmann */
Options Results;BotCMD='^';GetMyNick;MyNick=Result;UserHost MyNick;Hostx=Result;Rand=Random(1,5,time('s'));LVersion='0.98ß';CheckNick='';SVersion=d2c(2)'TeaBot'd2c(2)' 'LVersion' (22rd May 1999). [c] 97,98,99. This bot is dedicated to David Handsaker and Kaye Bannister the two people who brought a sparkle to my life, urg thats sick ! :)';If ~Exists("Ram:Time") Then Do;Open(Timie,'Ram:Time',W);WriteLn(Timie,Time(s));Close(Timeie);'ECHO P='d2c(27)'b«TeaBot» Made Time temp file.';Address command 'c:copy s:jlog ram:jlog';Address command 'resident c:copy pure';Address command 'c:Copy s:fish ram:fish';Address command 'c:copy s:MCP.Gurudat ram:MCP.Gurudat';Address command 'c:copy s:c-codes.txt ram:c-codes.txt';Address command 'c:copy s:faqlist ram:faqlist';Address command 'c:copy s:hangwords ram:hangwords';Address command 'c:copy s:hangtemp ram:hangtemp';If ~Exists("S:WorkSpace") Then Do;Open(WorkS,'S:WorkSpace',W);WriteLn(WorkS,'OFF');Close(WorkS)
'ECHO P='d2c(27)'b«TeaBot» Made OPS protection workspace file in S: Default is Ops Protect off.';End;If ~Exists("Env:FServ") Then FServAssign();Open(FS,"Env:FServ",R);Direct=ReadLn(FS);Address command 'Assign Fserv: 'Direct;'ECHO P='d2c(27)'b«TeaBot» Made assign 'direct' from Env:FServ';Close(FS);'ECHO P='d2c(27)'b«TeaBot» Data files setup.';'ECHO P='d2c(27)'b«TeaBot» This is TeaBot 'LVersion' the AmIRC bot.';Chan='';Do until Chan~='';GetChannel;Chan=result;End;If ~Exists("S:TeaMsg") Then Do;Open(TeaMsg,'S:TeaMsg',W);Close(TeaMsg);'ECHO P='d2c(27)'b«TeaBot» Made TeaBot Message tempfile.';End;Open(Worki,"s:workspace",r);stline=ReadLn(Worki);rdline=ReadLn(Worki);lline=ReadLn(Worki);Close(Worki);If lline='' Then do;'ECHO P='d2c(27)'b«TeaBot» Old workspace file found updating, "general channel join message" is Off to turn GMJ on /msg 'mynick' JoinMessage.';Open(Workie,"s:Workspace",W);WriteLn(Workie,stline);WriteLn(Workie,rdline);WriteLN(Workie,'OFF Welcome to my channel ! :)');lline='OFF';Close(Workie);End
If rdLine='' Then do;'ECHO P='d2c(27)'b«TeaBot» Old workspace file found updating, FServ is Off to turn Fserv on /msg 'mynick' FServAccess';Open(Workie,"s:Workspace",W);WriteLn(Workie,stline);WriteLN(Workie,'OFF');rdline='OFF';Close(Workie);End;Address command 'c:copy s:workspace ram:workspace';'RAW NOTICE 'Chan ' :<>< a ickle fishy.';If Upper(rdline)~='OFF' then 'RAW NOTICE 'Chan ' :'Mynick's FServ is ready for access, /msg 'Mynick' fserv';Call LOCALTest;If CheckNick~='' Then "RAW NOTICE" CheckNick ":-TeaBot Startup, "LVersion".";Exit;End;Open(Timie,'Ram:Time',R);EhTime=ReadLn(Timie);Close(Timie);If Time(s)>EhTime+300|EhTime-time(s)>0 Then Do;Open(Timie,'Ram:Time',W);WriteLn(Timie,Time(s));Close(Timie);'ECHO P='d2c(27)'b«TeaBot» Backed up userdatabase.';Address command 'c:copy ram:jlog s:jlog';End;Parse arg Cak':'Nick'!'username'@'Hosta' 'Junky'MSG 'Typeo':'Rest;If SubStr(Left(username,length(username)-(length(username)-1)),1)='~' Then Username=Substr(left(username,length(Username)),2)
If upper(cak)='JOIN' then Do;Joiny='1';LevelCh();End;If upper(cak)='MODE' then do;parse var junky mod' 'channell' 'ty' 'nicka;If upper(nick)~=upper(mynick)&upper(Nicka)~=Upper(mynick)&upper(ty)='-O' then do;GetChannel;Chan=result;If upper(nick)=upper(Nicka) then do;"RAW NOTICE" nick ":-Self deop detected";Exit;End;Open(Workspace,"ram:WorkSpace",R);Firstline=ReadLN(Workspace);If Upper(Firstline)='OFF' Then Exit;'ECHO P='d2c(27)'b«TeaBot» Ops Deop detected. Checking auth.';"RAW NOTICE" nick ":-Ops Deop detected, Checking your authority.";Hostname=Username'@'Hosta;Call CheckLev;If Levelx<4 Then Do;'RAW MODE 'chan' -o 'nick;'RAW MODE 'chan' +o 'nicka;"RAW NOTICE" nick ":-Your Deop authority failed !";"RAW NOTICE" nicka ":-Ops protection activated !";'RAW NOTICE 'Chan ' :-Ops protection activated.';Exit;End;Else "RAW NOTICE" nick ":-Deop authority granted !";End;if upper(nicka)=upper(mynick) Then Do;if upper(ty)='+O' then "RAW NOTICE" nick ":-Thanks mate ! :-)"
if upper(ty)='-O' then "RAW NOTICE" nick ":-Sob :~-(";if upper(ty)='+V' then "RAW NOTICE" nick ":-Thanks mate ! I have a wonderful voice :)";if upper(ty)='-V' then "RAW NOTICE" nick ":-Erk ! Come on its only voice dude ! :)";End;Exit;End;User=Nick;Chan=Typeo;Resty=Substr(left(Rest,length(rest)-1),2);Parse upper var Resty Thingy' 'Scum;Botx=SubStr(Left(Rest,length(rest)-(length(rest)-1)),1);Scummy=Substr(Left(Scum,length(scum)-(Length(Scum)-1)),1);Total=username'@'Hosta;If Thingy="PING"&Scummy~=' ' Then do;If Rand='1' Then Outp='TeaBot by Ste@inorbit.com';If Rand='2' Then Outp='TeaBot by Ste@inorbit.com';If Rand='3' Then Outp='TeaBot the Amiga BOT.';If Rand='4' Then Outp='Like a cup of tea ? :).';If Rand='5' Then Outp='TeaBot the Amiga BOT.';"RAW NOTICE" user ":"OutP;Exit;end;If Thingy='VERSION' Then Do;"RAW NOTICE" user ":"d2c(1)"VERSION "SVersion||d2c(1);Exit;End;If Thingy="DCC" Then do;Parse var Resty ' 'type' 'Filename' ';If type='CHAT' Then do;Thingy='XDCC';Mainstuff();End;If type='SEND' Then do
GETDCCRECEIVEDIR;DDir=Result;If Exists(DDir||Filename) Then Do;"Say /Dcc Resume "User;Exit;End;"RAW NOTICE" user ":I'll have a look at the file -"Filename"- Soon. :)";"Say /Dcc get "user;Exit;End;If type='MOVE' Then "RAW NOTICE" user ":DCC MOVE ? You sure (this Won't auto get)";Exit;End;Parse var rest Ht'//'Address' ';Htt=Upper(ht);httx=Right(htt,5);IF httx='HTTP:' Then do;If ~Exists("Ram:Temp") Then Do;Open(Loggy,'Ram:Temp',W);WriteLn(Loggy,"Http://members.tripod.com/~Mr_Q");Close(Loggy);End;fulladdrr='Http://'Address;Open(Test,"ram:temp",R);Do Until EOF(Test);MD=READLN(Test);If upper(FullAddrr)=upper(MD) Then do;Close(test);LevelCh();End;End;Open(temp,"ram:temp",A);WRITELN(Temp,FullAddrr);Close(test);close(temp);LevelCh();End;LevelCh();MainStuff: Procedure Expose LVersion Total Dyn Thingy MyNick Out Joiny Gret News Botx Blobby Chan Rest nick Typeo user username hosta Scummy Level BotCMD SVersion CL ddir systemcon;If Level=0 Then Exit;If Botx~=BotCMD&upper(Typeo)~=upper(MyNick)&Joiny~='1' then Exit
If upper(Typeo)=upper(Mynick)&Botx~=BotCMD Then Xest=Rest;Else Xest=Substr(left(Rest,length(rest)),2);Channels;Parse Var Result '#'TChan1'#'TChan2;Parse var Xest Commandx' 'Blobby;Command=upper(Commandx);If command='SHOWCOMMANDS'|Command='NICK'|Command='QUIT'|Command='PART'|Command='JOIN'|Command='SVIEW'|Command='INFO'|Command='LEVEL'|Command='HELP'|Command='FAQDEL'|Command='FAQLIST'|Command='URL'|Command='FAQADD' Then Sh=1;Com=Upper(Blobby);TChan1='#'TChan1;If TChan2~='' Then TChan2='#'TChan2;Else Chan=TChan1;If Joiny='1' Then do;Open(Workspace,"Ram:WorkSpace",R);Firstline=ReadLN(Workspace);SecondLine=ReadLN(Workspace);LastLine=ReadLN(Workspace);Parse Var Lastline Yeah' 'Messag;If upper(yeah)='ON' Then "RAW NOTICE" nick ":"Messag;Close(WorkSpace);Call MSGTest;If Level>='4' Then Do;If gret~=''&Upper(user)~=upper(Mynick) Then 'RAW NOTICE 'Chan ' :['user'] 'Gret;'RAW MODE 'Chan' +o 'User;'ECHO P='d2c(27)'b«TeaBot» Tried to op user 'User;If Upper(User)=Upper(Mynick) Then Do;Open(Workspace,"ram:WorkSpace",R)
Firstline=ReadLN(Workspace);SecondLine=ReadLN(Workspace);Close(Workspace);'RAW NOTICE 'Chan ' :<>< a ickle fishy.';If Secondline='ON' then 'RAW NOTICE 'Chan ' :'Mynick's FServ is ready for access, /msg 'Mynick' fserv';End;Exit;End;Else Do;If gret~=''&Upper(user)~=upper(Mynick) Then 'RAW NOTICE 'Chan ' :['User'] 'Gret;If Upper(User)=Upper(Mynick) Then Do;Open(Workspace,"ram:WorkSpace",R);Firstline=ReadLN(Workspace);SecondLine=ReadLN(Workspace);Close(Workspace);'RAW NOTICE 'Chan ' :<>< a ickle fishy.';If Secondline='ON' then 'RAW NOTICE 'Chan ' :'Mynick's FServ is ready for access, /msg 'Mynick' fserv';Exit;End;Exit;End;End;If upper(Typeo)=upper(Mynick)&TChan2~='' Then Do;Parse var Blobby TheChan' 'TheRest1;If upper(TheChan)=upper(TChan2) then kk=1;If upper(TheChan)=upper(TChan1) Then kk=1;If kk='KK'&SH~='1' Then Do;"RAW NOTICE" nick ":I am currently on two channels you must give your command like this,"
"RAW NOTICE" nick ":'/msg "MyNick" "Commandx" #TheChannel <the rest>', Messages to the channel are not affected by this.";"RAW NOTICE" nick ":I need to know which channel you want the outputed text to go to :)";Exit;End;Chan=Strip(TheChan);IF SH~='1' THEN Blobby=Therest1;End;If Command='SHOWCOMMANDS'|Command='COMMANDS'|Command='HELLO' then Showem();If Command='ME' Then Meem();If Command='OPSPROTECT'|Command='FSERVACCESS'|Command='GMJ'|Command='SETGMJ' Then OpsProem();If Command='NICK' Then Nickem();If Command='NUT' Then Nutem();If Command='FSERVASSIGN' Then FServem();If Command='VIEWGREET' Then ViewGreetem();If Command='HANG' Then Hangem();If Command='TELL' Then TELLem();If Command='KISS' Then Kissem();If Command='OK' Then OKem();If Command='MSG' Then MSGem();If Command='LEVEL' Then Levelem();If Command='HELP' Then Helpem();If Command='QUIT' Then Quitem();If Command='HANGR' Then HangR();If Command='SETGREET'|Command='DELGREET' Then SetGreetem();If Command='SLAP'|Command='FISH' Then Slapem()
If Command='SVIEW' Then SViewem();If Command='INFO' Then Infoem();If Command='PUNCH' Then Punchem();If Command='GURU' Then Guruem();If Command='STATUS' Then Statusem();If Command='URL' Then Urlem();If Command='SAY' Then Sayem();If Command='KISS' Then Kissem();If Command='CRY' Then Cryem();If Command='NACHOS' Then Nachosem();If Command='COUNTRY' Then Countryem();If Command='FAQ' Then Faqem();If Command='FAQDEL' Then Faqdelem();If Command='FAQLIST' Then Faqlistem();If Command='TOPIC' Then TOPICem();If Command='FAQADD' Then Faqaddem();If Command='PART' Then Partem();If Command='JOIN' Then Joinem();If Command='VERSION' Then Versionem();If Command='HUG' Then Hugem();If Command='MASS' Then Massem();If Command='OP'|Command='DEOP' Then OPem();If Command='FART' Then Fartem();If Command='TRYME' Then Tryme();If Command='FSERV'|Thingy='XDCC'|fs='1' Then Do;Open(Workspace,"ram:WorkSpace",R);If Command='FSERV'|Thingy='XDCC' Then Do;Open(Workspace,"ram:WorkSpace",R);Firstline=ReadLN(Workspace);SecondLine=ReadLN(Workspace)
If upper(Secondline)='OFF' Then do;"RAW NOTICE" user ":FServ is disabled, ask a user with level 6 to turn it on.";call LOCALTest;If CheckNick~='' Then "RAW NOTICE" CheckNick ":-TeaBot Notice, "Nick" tried FServ but it is disabled.";Exit;End;TestNick=Nick;Connected=0;"GETDCC";if dcc.chat.0>0 THEN DO i=1 TO dcc.chat.0;parse value dcc.chat.i WITH nick state hostname .;If State='2'&upper(nick)=upper(testnick) Then Do;"RAW NOTICE" TestNick ":-You are already in Fserv.";Exit;End;End;Call LOCALTest;If CheckNick~='' Then Do;"RAW NOTICE" CheckNick ":-TeaBot Notice, "Nick" just entered FServ.";End;Call FSERV;Exit;End;If Command='TELL'|Command='NEWS'|Command='SEEN' Then Do;"RAW NOTICE" user ":Not implimented yet Sorry ! :~-|";Exit;End;If Command='SERVER' Then Do;GETSERVERNAME;"RAW NOTICE" user ":I am on server "Result;Exit;end;If Thingy='PAGE'|Thingy='USERINFO'|Thingy='CLIENTINFO' Then Do;"RAW NOTICE" user ":-ERROR, Unknown CTCP command.";Exit;End
"RAW NOTICE" user ":-Unknown command "Commandx" please check your spelling.";Exit;Kissem: Procedure Expose Blobby Chan;If Blobby='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION gives himself a huge wet kiss 8)'d2c(1);Exit;End;If upper(blobby)='DIBBS' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION trys to kiss Dibbs but can''t, urg ;-)'d2c(1);Exit;End;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION gives 'Blobby' a huge wet kiss 8)'d2c(1);Exit;Statusem: Procedure Expose Lversion User Level Mynick;If level<4 then do;"RAW NOTICE" user ":-Sorry but level 4 is required to check the bots status.";Exit;End;Open(Myfile,"S:WorkSpace",r);one=ReadLN(MyFile);two=ReadLN(MyFile);three=ReadLN(MyFile);Parse var Three Three' 'Mess;"RAW NOTICE" user ":-Teabots internal status "LVersion;"RAW NOTICE" user ":-Opsprotection is "One", Fserv is "two".";"RAW NOTICE" user ":-GMJ is "three" and set to "Mess;testnick=MyNick;Call OPstest;If Haveop='0' then "RAW NOTICE" user ":-I don't have ops on this channel."
Else "RAW NOTICE" user ":-I do have ops on this channel.";"RAW NOTICE" user ":-End.";Exit;FServem: Procedure Expose Level User;If Level='6' Then Do;Call FServAssign;"RAW NOTICE" user ":-Made assign to "out;exit;End;Else "RAW NOTICE" user ":-Sorry FServ assign needs Level 6.";Exit;OPsProem: Procedure Expose Level Blobby User Command;If level~=6 then do;"RAW NOTICE" user ":-Sorry but level 6 is required for Bot operation changes.";Exit;End;Open(Workspace,"S:WorkSpace",R);Open(WriteSpace,"T:WorkSpace",W);Firstline=ReadLN(Workspace);SecondLine=ReadLN(Workspace);LastLine=ReadLN(Workspace);If Command='OPSPROTECT' Then Wantedone=Firstline;If Command='FSERVACCESS' Then Wantedone=Secondline;If Command='GMJ'|Command='SETGMJ' Then Parse Var Lastline Wantedone' 'Message;If Command='SETGMJ' Then Do;Parse Var Lastline Wantedone' 'Dumped;If Blobby~='' Then Message=Blobby;Else Do;"RAW NOTICE" user ":-You must tell me what message you want !";Exit;End;WriteLN(Writespace,FirstLine);WriteLN(Writespace,Secondline)
WriteLN(Writespace,Wantedone' 'Message);"RAW NOTICE" user ":-GMJ message is set to, "Message;Close(Writespace);Close(Workspace);Address command 'Copy T:Workspace Ram:workspace';Address command 'Copy T:Workspace s:workspace';Exit;End;If Upper(Wantedone)='OFF' Then do;If command='OPSPROTECT' Then Do;WriteLN(Writespace,'ON');WriteLN(Writespace,secondline);WriteLN(Writespace,lastline);"RAW NOTICE" user ":-OPS Protection is ON.";End;If Command='FSERVACCESS' Then Do;WriteLN(Writespace,FirstLine);WriteLN(Writespace,'ON');WriteLN(Writespace,lastline);"RAW NOTICE" user ":-FServ is ON.";End;If Command='GMJ' Then Do;WriteLN(Writespace,FirstLine);WriteLN(Writespace,Secondline);WriteLN(Writespace,'ON 'Message);"RAW NOTICE" user ":-GMJ is ON.";End;Close(Writespace);Close(Workspace);Address command 'Copy T:Workspace Ram:workspace';Address command 'Copy T:Workspace s:workspace';Exit;End;Else do;If command='OPSPROTECT' Then Do;WriteLN(Writespace,'OFF');WriteLN(Writespace,secondline);WriteLN(Writespace,lastline)
"RAW NOTICE" user ":-OPS Protection is OFF.";End;If Command='FSERVACCESS' Then Do;WriteLN(Writespace,FirstLine);WriteLN(Writespace,'OFF');WriteLN(Writespace,lastline);"RAW NOTICE" user ":-FServ is OFF.";End;If Command='GMJ' Then Do;WriteLN(Writespace,FirstLine);WriteLN(Writespace,Secondline);WriteLN(Writespace,'OFF 'Message);"RAW NOTICE" user ":-GMJ is OFF.";End;Close(Writespace);Close(Workspace);Address command 'Copy T:Workspace Ram:workspace';Address command 'Copy T:Workspace s:workspace';Exit;End;Exit;Massem: Procedure Expose Level User Chan Blobby botCMD Dyn username;If level~=6 then do;"RAW NOTICE" user ":-Sorry but level 6 is required for mass level changes.";Exit;End;Changes=0;Users=0;Total=username'@'dyn;Address command 'C:Copy Ram:JLog S:JLogBak';"RAW NOTICE" user ":-Made Backup of of the userdatabase to S:JLogBak";Open(Input,"ram:JLog",R);Open(Output,"ram:JLogChanged",W);Linein=ReadLN(Input);WriteLN(Output,Linein);"RAW NOTICE" user ":-Changing whole database to Level 1. -Please wait-"
Do until eof(Input);Linein=ReadLN(Input);If Linein~='' Then Do;Parse Var Linein NickA' 'TheirMask' 'Lev' 'Crap;If Upper(Total)~=Upper(TheirMask) Then Do;WriteLN(Output,NickA' 'TheirMask' '1' 'Crap);Users=Users+1;End;If Upper(Total)=Upper(TheirMask) Then do;WriteLN(Output,NickA' 'TheirMask' 'Lev' 'Crap);"RAW NOTICE" user ":-Found your mask leaving level at "Lev".";Users=Users+1;End;End;End;"RAW NOTICE" user ":-Complete, there are "Users" Users in your database.";Close(input);Close(output);Address command 'C:Copy Ram:JLogChanged S:JLog';Address command 'C:Copy Ram:JLogChanged Ram:JLog';Exit;Tellem: Procedure Expose Blobby Level User Mynick;If level<3 then do;"RAW NOTICE" user ":-Sorry but level 3 is required for tell.";Exit;End;Parse Var Blobby ReqNick' 'Msg;Nickomatic=ReqNick;Open(MyFile,"Ram:JLog",r);Do until eof(MyFile);Process=ReadLN(MyFile);Parse Var Process Nick1' 'Host1' 'Level1' 'Crap1;If Upper(Nick1)=Upper(ReqNick)|upper(Nick1)='*'||upper(reqnick) Then Do;ReqHost=Host1;Nick2=Nick1;End;End
Close(Myfile);If ReqHost='REQHOST' then do;"RAW NOTICE" user ":Sorry couldn't find the user "ReqNick" in the database";Exit;End;If Left(Nick2,1)~='*' Then Do;Open(Tempsave,"T:JSave",w);Open(ReadFile,"Ram:Jlog",r);Do until eof(ReadFile);ProcessLine=ReadLN(Readfile);Parse Var ProcessLine asda' 'HostCheck' 'Restofline;If Upper(Hostcheck)=Upper(Reqhost)&ProcessLine~='' then do;WriteLn(TempSave,'*'Processline);End;Else If ProcessLine~='' Then WriteLn(tempsave,Processline);End;End;If Left(Nick2,1)~='*' Then do;Open(SaveTo,"S:TeaMSG",A);WriteLN(SaveTo,'NEWUSER');WriteLN(SaveTo,ReqHost);WriteLn(SaveTo,User' left a message at 'Time(c)' 'date()'. 'Msg);"RAW NOTICE" user ":-Message for "Nickomatic"!"ReqHost" Stored.";Close(TempSave);Close(ReadFile);Call ison;Address command 'C:Copy T:JSave Ram:Jlog';Address command 'C:Copy T:JSave S:Jlog';Exit;End;Open(MSGRead,"S:TeaMSG",R);Open(MSGSave,"T:MSGSave",W);Do until eof(MSGRead);Lineofstuff=ReadLN(MSGRead);If upper(LineofStuff)=upper(reqhost) Then do;WriteLN(MSGSave,Reqhost)
WriteLN(MSGSave,user' left a message at 'Time(c)' 'date()'. 'Msg);"RAW NOTICE" user ":-Message for "Nickomatic"!"ReqHost" Stored.:)";Call ison;End;Else If lineofstuff~='' then WriteLn(MSGSave,Lineofstuff);End;Close(MSGREAD);Close(MSGSAVE);Address command 'C:Copy T:MSGSave S:TeaMSG';Exit;MSGem: Procedure Expose User Username Dyn MyNick;NDyn=Username'@'Dyn;Open(ThisFile,"S:TeaMSG",r);Do Until eof(ThisFile);ProcessLine=ReadLN(ThisFile);If Upper(ProcessLine)=Upper(NDyn) Then Do Until eof(ThisFile);ThisLine=ReadLn(Thisfile);If ThisLine='NEWUSER'|ThisLine='' Then Do;"RAW NOTICE" user ":-Use /Msg "MyNick" Ok to delete Message(s)";Exit;End;Parse Var Thisline a1'. 'a2;"RAW NOTICE" user ":-"a1;"RAW NOTICE" user ":-"a2;End;End;"RAW NOTICE" user ":-Sorry you don't have any messages";Exit;Okem: Procedure Expose User Dyn username;NDyn=username'@'Dyn;Open(SaveFile,"T:JTemp",w);Open(LoadFile,"Ram:Jlog",r);FLine=ReadLN(LoadFile);WriteLN(SaveFile,FLine);Do until eof(loadfile);Processline=ReadLN(loadFile)
Parse Var Processline Nicka' 'HostTest' 'Crap;If upper(Hosttest)=Upper(NDyn)&Left(Nicka,1)='*' Then do;WriteLN(SaveFile,SubStr(nicka,2,Length(Nicka)-1)' 'HostTest' 'Crap);Found=1;End;Else If ProcessLine~='' Then WriteLN(SaveFile,Processline);End;Close(SaveFile);Close(Loadfile);If Found~=1 Then Do;"RAW NOTICE" user ":-No message to Delete";Exit;End;Address Command 'C:Copy T:JTemp Ram:Jlog';Address Command 'C:Copy Ram:JLog s:Jlog';Open(LoadFile,"S:TeaMsg",r);Open(SaveFile,"T:MSGSave",w);Do until eof(Loadfile);ProcessLine=ReadLn(LoadFile);If ProcessLine='NEWUSER' Then rdline=ReadLn(loadfile);If ProcessLine='NEWUSER'&upper(rdLine)=upper(NDyn) Then Do until a=1;Processline=ReadLn(LoadFile);If Processline='NEWUSER'|ProcessLine='' Then a=1;End;If ProcessLine~='' Then Do;If upper(ProcessLine)~=Upper(NDyn) Then WriteLn(SaveFile,ProcessLine);If processline='NEWUSER'&upper(rdline)~=Upper(NDyn) Then WriteLn(SaveFile,rdline);End;End;Close(SaveFile);Close(Loadfile);Address Command 'C:Copy T:MSGSave S:TeaMsg'
If Found=1 Then "RAW NOTICE" user ":-Message(s) Deleted";Exit;Hangem: Procedure Expose Level User Chan Blobby botCMD;Saveput='';Output='';Found=0;tota=0;Blobby=upper(blobby);If blobby='' Then do;"RAW NOTICE" user ":-You must give me a letter to try eg. "botcmd"hang k";Exit;End;If ~Exists("Ram:HangTemp") Then Do;"RAW NOTICE" user ":-Nobody is playing Hangman, ask a operator with level 5+ to reset the game for you.";Exit;End;Open(Hangtemp,"ram:HangTemp",R);Outy=Readln(Hangtemp);Parse upper Var Outy Numbery' 'Picked' 'Nickp;If Outy='' Then Do;"RAW NOTICE" user ":-Nobody is playing Hangman, ask a operator with level 5+ to reset the game for you.";Exit;End;If nickp~=upper(user) then do;If Nickp~='' Then "RAW NOTICE" user ":-Sorry "Nickp" is playing, please wait your turn :-)";Exit;End;Outy=Readln(Hangtemp);SoFar=upper(Outy);If upper(blobby)=Upper(Picked) Then Do;'RAW NOTICE' user ':'-Picked' is correct ! 'user' wins :-)';Exit;End;Dw=0;Do num=1 for length(Picked);if substr(picked,Num,1)=upper(blobby) then Do
If substr(SoFar,Num,1)=upper(blobby) then do;'RAW NOTICE' user ':'blobby' has already been found !';Exit;End;Tota=tota+1;Output=Output||blobby;Saveput=saveput||blobby;Found=1;Ao=1;End;Else Do;If substr(SoFar,Num,1)~='-' then do;Output=Output||substr(SoFar,Num,1);Saveput=saveput||substr(SoFar,Num,1);Ao=1;End;End;If substr(SoFar,Num,1)='-'&ao~=1 then do;Output=Output||'-';Saveput=saveput||'-';DW=1;End;Ao=0;End;If DW=0 Then Do;'RAW NOTICE' user ':'Nickp': You win ! :-)';'RAW NOTICE' user ':'Nickp': The word was >>'Output'<<';Close(hangtemp);address command 'delete ram:hangtemp';Exit;End;If Found=0 Then Do;'RAW NOTICE' user ':'Nickp': Doesnt contain 'Blobby;numbery=numbery-1;If numbery=0 then do;Close(Hangtemp);address command 'delete ram:hangtemp';'RAW NOTICE' user ':Game over !';'RAW NOTICE' user ':The word was >>'Picked'<<';exit;End;'RAW NOTICE' user ':'Nickp': You now have 'numbery' lives. >>'Output'<<';address command 'delete t:hangtemp';Close(hangtemp);Open(Hanga,"t:HangTemp",W)
WriteLN(Hanga,numbery' 'picked' 'User);WriteLN(Hanga,Saveput);Close(Hanga);address command 'delete ram:hangtemp';address command 'copy t:hangtemp ram:hangtemp';Exit;End;'RAW NOTICE' user ':'nickp': There was 'tota' letters in the word. >>'Output'<< Lives left 'numbery;Close(Hangtemp);Close(Hanga);Open(Hanga,"t:HangTemp",W);WriteLN(Hanga,numbery' 'Picked' 'User);WriteLN(Hanga,Saveput);Close(Hanga);address command 'delete ram:hangtemp';address command 'copy t:hangtemp ram:hangtemp';exit;HangR: Procedure expose user Blobby Level mynick BotCMD HavePeep;Parse var Blobby Blobby' 'Wordi;Wordi=Strip(Wordi);If Blobby~='' then Do;testnick=Blobby;Call PEEPstest;If HavePeep='0' Then do;"RAW NOTICE" user ":"d2c(2)"-HangMan Error->"d2c(2)" Erk ! '"Blobby"' isn't on the channel 8-)";Exit;End;End;Else Blobby=User;Counter=1;Output='';If level<5 then do;"RAW NOTICE" user ":-Sorry but level 5 is required reset hangman.";Exit;End;If upper(Blobby)=upper(Mynick) then do;"RAW NOTICE" user ":-Don't be a plonka ;-)";Exit;End
If blobby~='' then do;bo=1;address command 'delete ram:hangtemp';Open(Hangtemp,"ram:HangTemp",W);Open(Hangword,"ram:Hangwords",R);If Strip(WORDI)='' Then Do;RandW=Random(1,40,time('s'));do until Counter=RandW;Wordi=ReadLn(Hangword);Counter=Counter+1;End;End;"RAW NOTICE" user ":-A game of hangman is setup for "blobby".";Call LOCALTest;If CheckNick~='' Then "RAW NOTICE" CheckNick ":TeaBot Notice-"user" just setup a game of Hangman.";If upper(User)~=upper(Blobby) Then "RAW NOTICE" user ":The secret word is "Wordi".";Else "RAW NOTICE" user ":Your Game is ready.... Use /Msg "MyNick" Hang <Letter>";WriteLN(HangTemp,'10 'Wordi' 'blobby);Do num=1 for length(wordi);Output=Output||'-';End;If bo=1 then do;WriteLN(HangTemp,Output);"RAW NOTICE" Blobby ":-Your Game is ready.... Use /Msg "MyNick" Hang <Letter>";"RAW NOTICE" Blobby ":"Output;"RAW NOTICE" Blobby ":10 lives left";Exit;End;End;Exit;SetGreetem: Procedure Expose Level User Blobby Command;If level<5 then do
If Command~='DELGREET' Then "RAW NOTICE" user ":-Sorry but level 5 is required to add a auto greet.";Else "RAW NOTICE" user ":-Sorry but level 5 is required to delete a auto greet.";Exit;End;Parse Var Blobby Therenick' 'Greet;If ThereNick=''&Command='DELGREET' Then Do;"RAW NOTICE" user ":-DelGreet Syntax is: DelGreet <Nick>";Exit;End;If Therenick=''|greet=''&Command~='DELGREET' Then Do;If Command~='DELGREET' Then "RAW NOTICE" user ":-SetGreet Syntax is: Setgreet <Nick> <Greet>";Exit;End;Open(JSave,"ram:Greetsave",W);Open(JList,"ram:JLog",R);Do Until EOF(JList);JLine=READLN(JList);Parse Var JLine Nick' 'Adr' 'lev' ';If upper(Nick)~=Upper(therenick)&Jline~='' Then WriteLN(JSave,Jline);If Upper(Nick)=upper(therenick) Then Do;If Command~='DELGREET' Then WriteLN(JSave,nick' 'adr' 'Lev' 'Greet);Else WriteLN(JSave,nick' 'adr' 'Lev);Found=1;End;End;If found=1 then Do;If Command~='DELGREET' Then "RAW NOTICE" user ":-Greet ("Greet") for "therenick" added.";Else "RAW NOTICE" user ":-Deleted the greet for "Therenick"."
Close(JSave);Close(JList);Address Command 'Copy Ram:GreetSave S:JLog';Address Command 'Copy Ram:GreetSave ram:JLog';Exit;End;Else "RAW NOTICE" user ":-Couldn't find "therenick" in the database.";exit;SHOWEM: Procedure Expose Level User BotCMD Con Lversion;If level<1&Con~='LEVELS' then do;"RAW NOTICE" user ":Sorry but level 1 is required for Showcommands.";Exit;End;If Level<0|Level>6 Then "RAW NOTICE" user ":"d2c(2)"Error"d2c(2)" You must specify a level, eg "Botcmd"Help levels 3. Levels are 0 to 6.";If Level=0 Then Do;"RAW NOTICE" user ":Level 0 the bot won't respond to any commands";Exit;End;If Level=1 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot ";"RAW NOTICE" user ":- Level 1 access";"RAW NOTICE" user ":Info Url Sview FServ Nachos Country";"RAW NOTICE" user ":Guru Showcommands Nut Hug Punch";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;If Level=2 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot "
"RAW NOTICE" user ":- Level 2 access";"RAW NOTICE" user ":Info Slap Punch Nachos Faq FaqList Country";"RAW NOTICE" user ":Url Say Me Fish Guru ";"RAW NOTICE" user ":SView Nut Hug Tryme FServ";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;If Level=3 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot ";"RAW NOTICE" user ":- Level 3 access";"RAW NOTICE" user ":Info Slap Punch Nachos Faq FaqAdd FaqList Country";"RAW NOTICE" user ":Url Say Me Fish Guru ";"RAW NOTICE" user ":SView Nut Hug Tryme FServ";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;If Level=4 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot ";"RAW NOTICE" user ":- Level 4 access";"RAW NOTICE" user ":Info Slap Punch Nachos Faq FaqAdd FaqList Country";"RAW NOTICE" user ":Url Say Me Fish Guru ";"RAW NOTICE" user ":SView Level Part Join Nut Hug Tryme"
"RAW NOTICE" user ":Topic FServ Status";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;If Level=5 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot ";"RAW NOTICE" user ":- Level 5 access";"RAW NOTICE" user ":Info Slap Punch Nachos Faq FaqAdd FaqList";"RAW NOTICE" user ":Url Say Me Fish Guru Country";"RAW NOTICE" user ":SView Level Part Join Nut Hug Tryme";"RAW NOTICE" user ":Topic SetGreet DelGreet ViewGreet FServ Status";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;If Level=6 then do;"RAW NOTICE" user ":- TeaBot "LVersion" The Amiga Bot ";"RAW NOTICE" user ":- Level 6 access";"RAW NOTICE" user ":Info Slap Nachos Faq FaqList FaqAdd FaqDel Mass";"RAW NOTICE" user ":Url Say Me Country Fish Guru Nut";"RAW NOTICE" user ":SView Level Quit Part Join Punch Nick";"RAW NOTICE" user ":Hug Fart Tryme Op Deop Topic FServ OpsProtect"
"RAW NOTICE" user ":SetGreet DelGreet ViewGreet Hangr FServAssign Status";"RAW NOTICE" user ":Help is available by using "BotCMD"Help [Command]";Exit;End;Helpem: Procedure Expose Lversion Level User Com BotCMD MyNick;"RAW NOTICE" user ":- Help on Commands";If Com='GURU' Then Do;"RAW NOTICE" user ": -Guru: Enter a Guru number, list isn't complete yet.";Exit;End;If Com='INFO' Then Do;"RAW NOTICE" user ": -Info: Information on the host system.";Exit;End;If Com='SLAP' Then Do;"RAW NOTICE" user ": -Slap: Have me slap someone. "BotCMD"Slap [Nick]";Exit;End;If Com='PUNCH' Then Do;"RAW NOTICE" user ": -Punch: Have me punch someone. "BotCMD"Punch [Nick]";Exit;End;If Com='NACHOS' Then Do;"RAW NOTICE" user ": -Nachos: Order Nachos, tell me who to send the bill to. "BotCMD"Nachos <Nick>";Exit;End;If Com='URL' Then Do;"RAW NOTICE" user ": -Url: This will private message you the current state of the URL database.";Exit;End;If Com='SAY' Then Do
"RAW NOTICE" user ": -Say: Make me talk ! "BotCMD"Say <The message>";Exit;End;If Com='ME' Then Do;"RAW NOTICE" user ": -Me: Make me do a action. "BotCMD"Me <The message>";Exit;End;If Com='FISH' Then Do;"RAW NOTICE" user ": -Fish: Just try :) "BotCMD"Fish [Nick]";Exit;End;If Com='FAQ' Then Do;"RAW NOTICE" user ": -Faq: Display a Fequently added question, Use Faq <Topic>, a list of topics can be got by using the Faqlist command.";Exit;End;If Com='FAQADD' Then Do;"RAW NOTICE" user ": -Faqadd: Faqadd <Drawer> <Topic> <Faq> adds a Faq. To see Current faq drawers type "botcmd"Faqlist";Exit;End;If Com='COUNTRY' Then Do;"RAW NOTICE" user ": -Country: Country <Code> Converts Internet country codes into English.";Exit;End;If Com='FAQLIST' Then Do;"RAW NOTICE" user ": -Faqlist: "botcmd"Faqlist shows the drawers in the database. "Botcmd"Faqlist <Draw> Shows the faq's in that draw.";Exit;End;If Com='LEVEL' Then Do
"RAW NOTICE" user ": -Level: Usage "BotCMD"Level <Nick> <Level> Levels are between 0 and 6, See Levels of a discription of them.";Exit;End;If Com='SVIEW' Then Do;"RAW NOTICE" user ": -SView: shows your current level, usage "BotCMD"SView, Level 4+ users can specify a nick eg, "BotCMD"SView <Nick> Don't forget you need level 4 for that ;) You can now use a wildcard eg "botcmd"Sview Mr*";Exit;End;If Com='' Then Do;"RAW NOTICE" user ": -Please do /Msg "MyNick" Showcommands";Exit;End;If Com='NUT' Then Do;"RAW NOTICE" user ": -Nut: Usage "BotCMD"Nut <Nick> make me headbut a irc user ;)";Exit;End;If Com='QUIT' Then Do;"RAW NOTICE" user ": -Quit: Usage "BotCMD"Quit, makes the Bot Quit IRC.";Exit;End;If Com='HUG' Then Do;"RAW NOTICE" user ": -Hug: Usage "BotCMD"Hug [Nick], if no nick is specifyed then I will hug the current channel :)";Exit;End;If Com='FART' Then Do;"RAW NOTICE" user ": -Fart: Usage "BotCMD"Fart [Nick], if no nick is specifyed then I will Fart in the current channel :)";Exit;End
If Com='TRYME' Then Do;"RAW NOTICE" user ": -Tryme: Usage "BotCMD"Tryme, play Russian roulette with the bot, it you get shot you get kicked ! ;-)";Exit;End;If Com='SETGREET' Then Do;"RAW NOTICE" user ": -SetGreet: Usage "BotCMD"SetGreet [Nick] [Greet], lets you specify a auto greet message for a user.";Exit;End;If Com='DELGREET' Then Do;"RAW NOTICE" user ": -Tryme: Usage "BotCMD"DelGreet [Nick], Lets you delete the auto greet for the specifyed user.";Exit;End;If Com='HANGR' Then Do;"RAW NOTICE" user ": -Hangr: Usage "BotCMD"Hangr [Nick], Lets you setup a one player game of Hangman for the nick specifyed.";Exit;End;If Com='FSERVASSIGN' Then Do;"RAW NOTICE" user ": -FServAssign: Usage "BotCMD"FservAssign, lets you change the dir that fserv calls home. Local use only.";Exit;End;If Com='FSERV' Then Do;"RAW NOTICE" user ": -FServ: Usage "BotCMD"Fserv, Starts TeaBots File Serve script.";Exit;End;If Com='MASS' Then Do
"RAW NOTICE" user ": -Mass: Usage "BotCMD"Mass, warning changes all users levels to 1 apart from your level.";Exit;End;If Com='OPSPROTECT' Then Do;"RAW NOTICE" user ": -OpsProtect: Usage "BotCMD"OpsProtect, turns on/off ops protection, when on only Level 4+ users can deop a op.";Exit;End;Parse var Com Con' 'Lev;If Con='LEVELS' Then Do;Level=Lev;Showem();End;"RAW NOTICE" user ":-Sorry there doesn't seem to be any help for the command "Com".";Exit;Opem: Procedure Expose User Level Chan Blobby Command Mynick HaveOp Testnick;If Blobby~='' then testnick=Blobby;Else Testnick=User;Call OPstest;If Haveop='1'&Upper(Command)='OP' then do;If Blobby~='' then "RAW NOTICE" user ":-"Blobby" already has ops !";If Blobby='' Then "RAW NOTICE" user ":-You already have ops :)";Exit;End;If Haveop='0'&Upper(Command)='DEOP' then do;If Blobby~='' Then "RAW NOTICE" user ":-"Blobby" is already Deoped.";If Blobby='' Then "RAW NOTICE" user ":-You already are deoped :)";Exit;End;If level<4 then do
"RAW NOTICE" user ":-Sorry but level 4 is required for op/deop.";Exit;End;If upper(blobby)=upper(mynick) Then do;"RAW NOTICE" user ":-Not this time bud ! :-P";Exit;end;If blobby~='' then do;If upper(command)='OP' Then 'RAW MODE 'Chan' +o 'blobby;else 'RAW MODE 'Chan' -o 'blobby;Exit;End;If upper(command)='OP' Then 'RAW MODE 'Chan' +o 'User;else 'RAW MODE 'Chan' -o 'User;Exit;ViewGreetem: Procedure Expose User Level Blobby;If level<5 then do;"RAW NOTICE" user ":-Sorry but level 5 is required for ViewGreet.";Exit;End;If blobby='' then do;"RAW NOTICE" user ":-You must give me a nick to lookup the greet of.";Exit;End;Open(JList,"ram:JLog",R);A=0;Do Until EOF(JList);JLine=READLN(JList);Parse Var JLine Nicky' 'Adr' 'Lev' 'crap;If Upper(Nicky)=Upper(Blobby)&Crap~='' Then Do;Parse Var Adr Usern'@'Adr;If pos(Adr,'0123456789')=0 Then Dyn='@*.'Adr;Else Dyn='@'Adr'.*';If A=0 Then "RAW NOTICE" user ":Greets for user "Blobby;"RAW NOTICE" user ":"Nicky"!"Usern||dyn" >>>>> "Crap;A=1;End;End
If A=0 Then "RAW NOTICE" user ":Sorry but there isn't any Greet for user "Blobby;Exit;Kissem: Procedure Expose Blobby Chan;If Blobby='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION gives himself a huge wet kiss 8)'d2c(1);Exit;End;If upper(blobby)='DIBBS' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION trys to kiss Dibbs but can''t, urg ;-)'d2c(1);Exit;End;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION gives 'Blobby' a huge wet kiss 8)'d2c(1);Exit;Topicem: Procedure Expose User Level Chan Blobby Command Mynick;If level<4 then do;"RAW NOTICE" user ":-Sorry but level 4 is required for Topic.";Exit;End;Call Opstest;If blobby='' then do;"RAW NOTICE" user ":-You must tell me what you want in the topic !";Exit;end;'RAW TOPIC 'chan' :'Blobby;Exit;Nickem: Procedure Expose User Level Chan Blobby Command Mynick;If level<5 then do;"RAW NOTICE" user ":-Sorry but level 6 is required for Nick.";Exit;End;If blobby='' then do;"RAW NOTICE" user ":-You must tell me my new nick.";Exit;end;'RAW NICK :'Blobby;Exit
SViewem: Procedure Expose Level User Nick Blobby Username Dyn;If Blobby='' Then do;"RAW NOTICE" nick ": -Mask------------Level---";aa=Right(dyn,1);If pos(aa,'0123456789')=0 Then "RAW NOTICE" nick ":"Username"@*."Dyn" "Level;Else "RAW NOTICE" nick ":"Username"@"Dyn".* "Level;Exit;End;Wild=Substr(left(Blobby,length(Blobby)),length(blobby));If Wild='*' Then Do;If Length(Blobby)>1 Then Blobby=Substr(left(blobby,length(blobby)-1),1);If Wild='*'&Blobby='*' Then Do;"RAW NOTICE" user ":"d2c(2)"Error"d2c(2)", Invalid wildcard !";Exit;End;End;If blobby~=''&Level>=4 then do;"RAW NOTICE" nick ": -Nick----Mask------------Level---";Open(JList,"ram:JLog",R);A=0;Do Until EOF(JList);JLine=READLN(JList);Parse Var JLine Nicky' 'Adr' 'Lev' 'crap;If left(Nicky,1)='*' then Nicky=Substr(Nicky,2,length(Nicky));aa=Right(adr,1);If pos(aa,'0123456789')=0 Then IsIt=1;Else IsIt=0;If Upper(Nicky)=Upper(Blobby)&Wild~='*' Then Do;If IsIt=1 Then Do;Parse Var Adr Bit1'@'Bit2' 'Crap
"RAW NOTICE" nick ":"Nicky" "Bit1"@*."Bit2" "Lev;End;Else "RAW NOTICE" nick ":"Nicky" "Adr".* "Lev;A=1;End;If Wild='*' Then do;Kl=left(nicky,length(Blobby));If upper(kl)=Upper(blobby) Then do;If IsIt=1 Then Do;Parse Var Adr Bit1'@'Bit2' 'crap;"RAW NOTICE" nick ":"Nicky" "Bit1"@*."Bit2" "Lev;End;Else "RAW NOTICE" nick ":"Nicky" "Adr".* "Lev;A=1;End;End;End;If Wild='*'&A=0 Then "RAW NOTICE" nick ":The user `"Blobby"` (Wildcard) wasn't found in the user database.";Else If A=0 Then "RAW NOTICE" nick ":The user `"Blobby"` wasn't found in the user database.";Exit;End;Exit;Infoem: Procedure Expose LVersion Level User Systemcon Sversion;"RAW NOTICE" user ":-TeaBot "LVersion" Infomation";"RAW NOTICE" user ":"SVersion;"RAW NOTICE" user ":TeaBot is Emailware and downloadable from the Aminet.";"RAW NOTICE" user ":TeaBot was produced by Stephen Evans (MrQue)";"RAW NOTICE" user ":<>< a ickle fishy. Mailto:Ste@Inorbit.Com";Exit;Joinem: Procedure Expose Blobby Level User Tchan1 Tchan2
If level<6 then do;"RAW NOTICE" user ":-Sorry but level 6 is required for Join.";Exit;End;If TChan1~=''&TChan2~='' Then Do;"RAW NOTICE" user ":-Sorry but I'm already on two channels.";Exit;End;Blobby=Strip(Blobby);"RAW NOTICE" user ":-Attempting to join "Blobby;'Say /JOIN 'Blobby;Exit;Partem: Procedure Expose Blobby Level User TChan1 TChan2;If level<6 then do;"RAW NOTICE" user ":-Sorry but level 6 is required for Part.";Exit;End;If Strip(TChan2)~='' Then Do;"RAW NOTICE" user ":-You must tell me a channel to part";Exit;End;Blobby=Strip(Blobby);"RAW NOTICE" user ":-Attempting to part channel.";'Say /PART 'Blobby;Exit;Nutem: Procedure Expose Level Blobby User Chan;If Blobby~='' Then Do;'RAW PRIVMSG 'Chan ' :'d2c(1)'ACTION nuts 'Blobby's head and 'Blobby' falls to the floor in total pain while bleeding from the eyes.'d2c(1);Exit;End;Else "RAW NOTICE" user ":"d2c(2)"-Error"d2c(2)", You must tell me who to nut.";Exit;Hugem: Procedure Expose Level Blobby User Chan
If Blobby='' Then 'RAW PRIVMSG 'Chan ' :'d2c(1)'ACTION Hugs 'Chan' init that nice ;-)'d2c(1);If Blobby~='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION hugs 'Blobby' :-)'d2c(1);Exit;End;Exit;Fartem: Procedure Expose Level Blobby User Chan;If Blobby~='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION farts at 'Blobby' then watches 'Blobby's face =-) Farrrrrtttt ;-)'d2c(1);End;Else 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION farts in 'chan', wow those beans rule =-)'d2c(1);Exit;Levelem: Procedure Expose Level Blobby User Nick BotCMD MyNick;If level<5 then do;"RAW NOTICE" user ":-Level requires level 5+";Exit;End;if blobby='' then DO;"RAW NOTICE" nick ":"d2c(2)"-Error"d2c(2)", tell me who to change the level of.";exit;end;Parse var Blobby Nicko' 'Levelo;If levelo>'6'|levelo<'0' Then Do;"RAW NOTICE" user ":-"d2c(2)"Error"d2c(2)", Incorrect level, levels are 0 to 6.";Exit;End;If levelo='' Then Do;"RAW NOTICE" user ":-"d2c(2)"Error"d2c(2)", Tell me the level to change to, levels are 0 to 6.";Exit;End
If level<'6'&levelo='6' Then do;"RAW NOTICE" user ":-"d2c(2)"Error"d2c(2)", You need level 6 to change a level past 4.";Exit;end;Found=0;Parse Var Nicko n1'@'n2;If N2='' Then do;testnick=Nicko;Call PEEPstest;If HavePeep='0' Then do;"RAW NOTICE" user ":"d2c(2)"-Level Error->"d2c(2)" Erk ! '"TestNick"' isn't on the channel, looking for Hostmasks.";Open(JList,"ram:JLog",R);A=0;Do Until EOF(JList);JLine=READLN(JList);Parse Var JLine Nicky' 'Adr' 'Lev' 'Crap;If left(Nicky,1)='*' then Nicky=Substr(Nicky,2,length(Nicky));aa=Right(adr,1);If pos(aa,'0123456789')=0 Then IsIt=1;Else IsIt=0;If Upper(Nicky)=Upper(TestNick) Then Do;A=1;If isit=1 Then Do;Parse Var Adr Bit1'@'Bit2' 'Crap;"RAW NOTICE" User ":"Nicky"!"Bit1"@*."Bit2" Current level "Lev;End;If isit=0 Then Do;Parse Var Adr Bit1'@'Bit2' 'Crap;"RAW NOTICE" User ":"Nicky"!"Bit1"@"Bit2".* Current level "Lev;End;End;End;If A=1 Then Do;"RAW NOTICE" User ":-No more found."
If isit=1 Then "RAW NOTICE" User ":-To change level use eg, "BotCMD"Level "Bit1"@*."Bit2" [Level]";Else "RAW NOTICE" User ":-To change level use eg, "BotCMD"Level "Bit1"@"Bit2".* [Level]";Exit;End;If A=0 Then "RAW NOTICE" User ":Not Found ! Erk !";Exit;End;End;If HavePeep=1 Then Do;Userhost Nicko;Hostmask=result;aa=Right(Hostmask,1);If pos(aa,'0123456789')=0 Then Do;Parse Var Hostmask Host'@'Crap'.'Dyn' ';Dynn=Dyn;End;Else Do;Parse Var Hostmask Host'@'Ag '.' Bg '.' Cg '.';Dyn=Ag'.'Bg'.'Cg;Dynn=Ag'.'Bg'.'Cg;End;HostMask=Host'@'||Dynn;Nickoo=Nicko;"RAW NOTICE" User ":-Looking for "Nicko"!"Hostmask" in userdatabase.";End;Else Do;Parse var n2 m1'*'m2;If m2='' Then Hostmask=n1'@'Substr(left(m1,length(m1)-1),1);Else Hostmask=n1'@'Substr(Right(m2,length(m2)),2);End;Open(JList,"ram:JLog",R);Open(JSave,"T:Jsave",W);Found=0;Do Until EOF(JList);ALine=READLN(JList);Parse Var ALine Nicko' 'Adr' 'Olev;If upper(adr)~=Upper(Hostmask)&Aline~='' Then WriteLN(JSave,Aline);If Upper(adr)=upper(Hostmask) Then Do
If OLev='5'&Level='4' Then Do;"RAW NOTICE" user ":-"d2c(2)"Error"d2c(2)", You need level 5 to change the level of a level 5 user.";Exit;end;"RAW NOTICE" User ":-Found, changing the level of user "nicko"!"Hostmask" to "Levelo;WriteLN(JSave,nicko' 'adr' 'Levelo);Found=1;OOLev=OLev;End;End;Close(JList);Close(JSave);Parse Var blobby niccc' ';If Levelo=OOLev then Do;"RAW NOTICE" user ":-"Hostmask" already had that level !";Exit;End;If found=0 Then do;"RAW NOTICE" user ":-"Niccc " wasn't found !";Exit;End;Address Command 'Copy T:Jsave S:JLog';Address Command 'Copy T:Jsave ram:JLog';"RAW NOTICE" user ":"niccc"!"Hostmask" now has level "Levelo;If Levelo>OOLev then Do;"RAW NOTICE" Nickoo ":-"User" has increased your level to "Levelo".";End;If Levelo<OOLev then Do;"RAW NOTICE" Nickoo ":-"user" has lowered your level to "Levelo".";End;Call LOCALTest;If CheckNick~=''&Upper(CheckNick)~=Upper(user) Then Do;"RAW NOTICE" CheckNick ":-Level change notice, Change by"user", "Hostmask" now has level "Levelo;End;Exit
Punchem: Procedure Expose Level user Blobby Chan;If Blobby~='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION sees 'user' punch 'Blobby's nose and it explodes like a water melon.'d2c(1);Exit;End;Else "RAW NOTICE" user ":-You must tell me who to punch";Exit;Exit;Nachosem: Procedure Expose Level user Blobby Chan;If Blobby='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION orders Nachos for all on 'Chan' and sends the bill to Beavis and Butthead.'d2c(1);Exit;End;Else 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION orders Nachos for all on 'Chan' and sends the bill to 'Blobby'.'d2c(1);Exit;Cryem: Procedure Expose Level user Blobby Chan;If Blobby~='' Then Do;'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION looks at 'blobby' then cries.'d2c(1);Exit;End;Else "RAW NOTICE" user ":-You must tell me who to cry for.";Exit;Versionem: Procedure Expose SVersion Chan;'RAW PRIVMSG 'Chan' :Version '||SVersion;Exit;Urlem: Procedure Expose Level User;If ~Exists("Ram:Temp") Then Do;Open(Loggy,'Ram:Temp',W);WriteLn(Loggy,"Http://members.tripod.com/~Mr_Q")
Close(Loggy);End;Open(Stuff,"Ram:Temp",R);Do until EOF(Stuff);Line=READLN(Stuff);If Line~='' Then "RAW NOTICE" user ":"Line;End;Exit;Sayem: Procedure Expose Level User Blobby BotCMD K Chan;If level<2 then do;"RAW NOTICE" user ":-Sorry but level 2 is required for Say.";Exit;End;K=SubStr(Blobby,1,1);If K='!'|K='/'|K='+'|K=BotCMD Then Do;"RAW NOTICE" user ":That action as been recorded, have a nice day :^)";Exit;End;If Level<5 Then 'RAW PRIVMSG 'Chan' :'d2c(2)'«'d2c(2)||User||d2c(2)'» 'd2c(2)||Blobby;Else 'RAW PRIVMSG 'Chan' :'Blobby;Exit;Meem: Procedure Expose Level User Blobby Chan;If level<2 then do;"RAW NOTICE" user ":-Sorry but level 2 is required for Me.";Exit;End;If level<5 Then 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION 'Blobby' ('User')'d2c(1);Else 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION 'Blobby||d2c(1);Exit;Slapem: Procedure Expose Level User Blobby Command Chan;If level<2 then do;"RAW NOTICE" user ":-Sorry but level 2 is required for Fish/Slap.";Exit;End;If Blobby~='' Then Do;If ~Exists("ram:Fish") Then Do
"Say -Fish list isn't installed, the user sucks ;)";Exit;End;FRand=Random(1,145,time('s'));Start=1;Open(Fish,"ram:Fish",R);Do until Start=FRand;Line=READLN(Fish);Start=Start+1;End;If command='FISH' Then 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION puts a 'Line' down 'Blobby'''s pants, now you''ll smell better ;)'d2c(1);If command='SLAP' Then 'RAW PRIVMSG 'Chan' :'d2c(1)'ACTION slaps 'Blobby' about a bit with a 'Line'.'d2c(1);Exit;End;Else "RAW NOTICE" user ":You must give me a nick :)";Exit;Tryme: Procedure Expose Level User Chan Mynick Blobby Haveop;testnick=MyNick;Call OPstest;If Haveop='0' then do;"RAW NOTICE" user ":-Sorry I don't have ops :-( Go on op me now and play ! ;-)";Exit;End;If level<2 then do;"RAW NOTICE" user ":-Sorry but level 2 is required for Tryme.";Exit;End;If upper(blobby)=upper(mynick) Then do;"RAW NOTICE" user ":Not this time bud ! :-P";Exit;end;If level>=6&blobby~='' then User=blobby;FRand=Random(1,7,time('s'));If Frand=3 then Do
'RAW NOTICE 'Chan' :I point the gun at 'User' and fire, -- BOOOM --';'RAW KICK 'chan' 'user' : - Ha ha Wimp ! :-)';Exit;End;Else 'RAW NOTICE 'Chan' :I point the gun at 'User' and fire, -- Click --';Exit;Guruem: Procedure Expose Level User Blobby Chan Typeo Mynick;If ~Exists("ram:MCP.Gurudat") Then Do;"RAW NOTICE" user ":-Sorry Guru database doesn't seem to be installed :-(";Exit;End;If blobby='' then do;"RAW NOTICE" user ":-Give me a Guru number.";Exit;End;Blobbyy=Upper(Blobby);Open(Gurulist,"ram:MCP.Gurudat",R);Do Until EOF(Gurulist);MD=READLN(Gurulist);Parse Var MD Gurru' 'Error;If Gurru=Blobbyy&Upper(Typeo)~=upper(Mynick) Then do;'RAW PRIVMSG 'Chan' :Guru = 'Blobby' 'Error;Exit;End;If Gurru=Blobbyy&Upper(Typeo)=upper(Mynick) Then do;'RAW PRIVMSG 'User' :Guru = 'Blobby' 'Error;Exit;End;End;"RAW NOTICE" user ":Guru not found.";Exit;Faqem: Procedure Expose Level Blobby User BotCMD Chan;If level<2 then do;"RAW NOTICE" user ":Sorry but level 2 is required for Faq.";Exit;End;If Blobby='' Then Do
"RAW NOTICE" user ":-Which Faq ? Use "BotCMD"Faqlist to see them.";Exit;End;If ~Exists("S:FAQList") Then Do;Open(Loggy,'S:FAQList',W);WriteLn(loggy,' ');WriteLn(Loggy,'@Users');WriteLn(Loggy,'TeaBot by MrQue 1998.');Close(Loggy);address command 'c:copy s:faqlist ram:faqlist';End;Open(FAQList,"Ram:FAQList",R);blobbyy=upper(Blobby);Do Until EOF(FAQList);MD=READLN(FAQList);Parse Var MD FAQ' 'LIST;FAQQ=Upper(FAQ);If Left(faqq,1)='@'&Faqq=Blobbyy then do;"RAW NOTICE" user ":-The requested Faq '"blobby"' appears to be a drawer !";Exit;End;If Faqq='@'||Blobbyy then do;"RAW NOTICE" user ":-Error, '"Blobby"' is a drawer not a faq !! Use "botcmd"faqlist "Blobby;Exit;End;If FAQQ=Blobbyy Then do;'RAW NOTICE 'Chan' :'d2c(2)'Faq, 'FAQ' 'd2c(2)||' - 'LIST;Exit;End;End;"RAW NOTICE" user ":The Faq "Blobby" doesn't seem to be in the database.";Exit;Faqaddem: Procedure Expose Level Blobby User;If level<3 then do;"RAW NOTICE" user ":-Sorry but level 3 is required for FaqAdd.";Exit;End;Parse Var Blobby Draw' 'Topic' 'Disc
If Draw=''|Topic=''|Disc='' Then do;"RAW NOTICE" user ":-Error, you haven't suppied me with the correct infomation ! Use Faqadd <Draw> <Topic> <Message> ! ";Exit;End;If Left(Topic,1)='@'|left(draw,1)='@' Then Do;"RAW NOTICE" user ":-Error, You can't have a Topic or Draw starting with a '@'.";Exit;End;Draws=Draw;Draw='@'Draw;NR=0;Open(Faqlist,"Ram:faqlist",r);Open(Savelist,"T:faqtemp",w);Do Until eof(faqlist);Linea=readln(faqlist);Parse var linea Bit1' 'Bit2;Writeln(savelist,linea);If upper(Bit1)=Upper(topic) Then Do;"RAW NOTICE" user ":-Sorry, the faq is already in the database! Use Faqdel to remove it.";Exit;end;If Upper(bit1)=Upper(draw) Then Do until eof(Faqlist);Parse var linea Bit1' 'Bit2;If upper(Bit1)=Upper(topic) Then Do;"RAW NOTICE" user ":-Sorry, the faq is already in the database! Use Faqdel to remove it.";Exit;end;If Nr=0 Then Do;If Left(linea,1)='@'|Left(linea,1)='' Then Do;Writeln(SaveList,Topic' 'Disc);Nr=1;End;End;If Left(linea,1)~='@' then Writeln(Savelist,Linea);Linea=Readln(faqlist)
If left(linea,1)='@'&linea~='' then writeln(savelist,linea);End;End;If Nr=0 Then Do;Writeln(savelist,Draw);Writeln(savelist,topic' 'disc);"RAW NOTICE" user ":-Made new Drawer '"Draws"' and added your faq '"topic"' to it.";Close(Savelist);Close(Faqlist);Address command 'C:Copy t:faqtemp ram:faqlist';Address command 'C:Copy t:faqtemp s:faqlist';Exit;End;Close(Savelist);Close(Faqlist);If Nr=1 Then Do;"RAW NOTICE" user ":-Added your Faq '"Topic"' into the drawer '"Draws"'";Address command 'C:Copy t:faqtemp ram:faqlist';Address command 'C:Copy t:faqtemp s:faqlist';end;Exit;Faqlistem: Procedure Expose Level Blobby User;If level<2 then do;"RAW NOTICE" user ":-Sorry but level 2 is required for Faqlist.";Exit;End;TotalOut='';Open(Faqlist,"Ram:faqlist",r);Do until eof(faqlist);Linea=readln(Faqlist);aaa=Substr(left(Linea,length(Linea)),2);If Blobby='' Then do;"RAW NOTICE" user ":Faq drawers >:";Do until eof(faqlist);If Left(Linea,1)='@' Then Do;Found=1;Lineas=Linea;End;Linea=readln(faqlist)
If Linea~=''&Found=1 Then Totalout=totalout||Substr(left(Lineas,length(Lineas)),2)||' ';Found=0;If words(totalout)=7 Then Do;"RAW NOTICE" user ":"Totalout;Totalout='';End;End;If words(totalout)~=0 then "RAW NOTICE" user ":"Totalout;End;If Blobby~='' Then do;If Upper(aaa)=upper(Blobby)&Left(Linea,1)='@' Then do;"RAW NOTICE" user ": "Blobby":";Do until eof(faqlist);Lineb=readln(faqlist);If Left(Lineb,1)~='@' Then do;Parse var Lineb Bit1' 'Rest;Totalout=Totalout||Bit1||' ';If Words(totalout)=7 Then Do;"RAW NOTICE" user ":"Totalout;Totalout='';End;End;If Left(Lineb,1)='@' Then do;If Words(totalout)~=0 Then Do;"RAW NOTICE" user ":"Totalout;Exit;End;exit;End;End;If Words(totalout)~=0 Then "RAW NOTICE" user ":"Totalout;End;End;End;Faqdelem: Procedure Expose Level Blobby User;If level<5 then do;"RAW NOTICE" user ":-Sorry but level 5 is required for FaqDel.";Exit;End;A=0;If topic='' Then Do;"RAW NOTICE" user ":-Tell me which Faq to delete.";Exit;End;Open(FAQList,"S:FAQList",R);Open(FAQSAVE,"T:FAQLIST",W)
Do Until EOF(FAQList);Parse Var FaqLine Topic' ';If Upper(Topic)=upper(Blobby) Then Do;"RAW NOTICE" user ":-The Faq '"Blobby"' was deleted.";A=1;End;If Upper(Topic)~=upper(Blobby)&Faqline~='FAQLINE' Then WRITELN(FAQSAVE,FAQLINE);FAQLine=READLN(FAQList);End;Close(FAQSAVE);Close(FAQList);If A=0 Then Do;"RAW NOTICE" user ":-No Faq ("blobby") to delete.";Exit;End;Address Command 'C:Copy T:FAQLIST S:FAQLIST';Address Command 'C:Copy T:FAQLIST RAM:FAQLIST';Exit;Countryem: Procedure Expose Level Blobby User Chan Typeo Mynick;If Blobby='' Then Do;"RAW NOTICE" user ":-Tell me a Country code to look up.";Exit;End;If ~Exists("ram:c-codes.txt") Then Do;"RAW NOTICE" user ":-Country database file doesn't exist :(";Exit;End;C=Upper(Blobby);Open(CList,"ram:c-codes.txt",R);Do Until EOF(CList);CLine=READln(CList);Parse Var CLine CC' 'Rest;If C=CC&upper(Typeo)~=Upper(Mynick) Then do;'RAW PRIVMSG 'Chan' :'d2c(2)||Blobby||d2c(2)||' is 'rest;Exit;End;If C=CC&upper(Typeo)=Upper(Mynick) Then do
'RAW PRIVMSG 'User' :'d2c(2)||Blobby||d2c(2)||' is 'rest;Exit;End;End;"RAW NOTICE" user ":The country ("Blobby") wasn't found.";Exit;Quitem: Procedure Expose Level User Chan;If level<6 then do;"RAW NOTICE" user ":Sorry but level 6 is required for Quit.";Exit;End;Address command 'c:copy ram:jlog s:jlog';'RAW PRIVMSG 'Chan' :-TeaBot terminating...';'Say /QUIT The Bot of the future !!';Exit;CheckLev:;aa=Right(Hosta,1);If pos(aa,'0123456789')=0 Then Parse Var Hosta '.'Dyn' ';Else Do;Parse Var Hosta Ag '.' Bg '.' Cg '.';Dyn=Ag'.'Bg'.'Cg;End;Open(Test,"ram:JLog",R);Do Until EOF(Test);MD=READLN(Test);parse var MD Nicky' 'Usero'@'Domain' 'Levelx' 'Gret;If Upper(Usero)=upper(Username)&Upper(Domain)=upper(Dyn) Then Return;End;Return;OPstest:;HaveOP='0';Getusers;Peps=result;Peps=Upper(peps);Do num=1 for words(peps);if Upper(testnick)=substr(word(peps,num),2)&substr(word(peps,num),1,1)='@' then haveop='1';End;Return;PEEPstest:;HavePeep='0';Getusers;Peps=result;Peps=Upper(peps);Do num=1 for words(peps)
if Upper(testnick)=substr(word(peps,num),2)&substr(word(peps,num),1,1)='@' then havepeep='1';if Upper(testnick)=substr(word(peps,num),1) then havepeep='1';End;Return;LOCALtest:;HaveLocal='0';UserHost MyNick;Hostx=Result;Getusers;Peps=result;Peps=Upper(peps);Do num=1 for words(peps);If substr(word(peps,num),1,1)='@' Then do;CheckNick=substr(word(peps,num),2);UserHost CheckNick;CheckHost=Result;If Upper(Hostx)=Upper(CheckHost)&upper(CheckNick)~=upper(Mynick) Then Return;End;If substr(word(peps,num),1,1)~='@' then do;CheckNick=substr(word(peps,num),1);UserHost CheckNick;CheckHost=Result;If Upper(Hostx)=Upper(CheckHost)&upper(CheckNick)~=upper(Mynick) Then Return;End;End;CheckNick='';Return;LevelCh: Procedure Expose LVersion Total Thingy Joiny Hostx Dyn MyNick Botx Blobby Chan Rest nick Typeo user username hosta Scummy Level BotCMD SVersion CL ddir systemcon;user=Nick;do;Parse var Hosta '.'Dyn' ';If ~Exists("S:JLog") Then Do;Open(Loggy,'ram:JLog',W);WriteLn(Loggy,'***TUUD1')
WriteLn(Loggy,Nick' 'Username'@'Dyn' 1');Close(Loggy);MainStuff();End;aa=Right(Hosta,1);If pos(aa,'0123456789')=0 Then Do;Parse Var Hosta '.'Dyn' ';Dynn='*.'||Dyn;End;Else Do;Parse Var Hosta Ag '.' Bg '.' Cg '.';Dyn=Ag'.'Bg'.'Cg;Dynn=Ag'.'Bg'.'Cg'.*';End;Open(Test,"ram:JLog",R);Do Until EOF(Test);MD=READLN(Test);parse var MD Nicky' 'Usero'@'Domain' 'Level' 'Gret;If Upper(Usero)=upper(Username)&Upper(Domain)=upper(Dyn) Then Do;Close(test);MainStuff();End;End;Close(test);getchannel;chan=result;If Total~=Hostx Then do;Open(temp,"ram:JLog",A);WRITELN(Temp,nick' 'username'@'dyn' 1');Close(Temp);Address command 'C:Copy ram:Jlog s:Jlog';"RAW NOTICE" nick ":Welcome to "Chan" I'm TeaBot, The Amiga Bot.";"RAW NOTICE" nick ":Use /msg "Mynick" Showcommands to see commands at your level.";"RAW NOTICE" nick ":You are currently at level 1, ask a operator with level";"RAW NOTICE" nick ":4 or above to raise your level.";'ECHO P='d2c(27)'b«TeaBot» Added user 'Nick'!'username'@'dynn;Call LOCALTest
If CheckNick~='' Then "RAW NOTICE" CheckNick ":-TeaBot Notice, added user "Nick"!"username"@"dynn;MainStuff();End;Else Do;Open(temp,"ram:JLog",A);WRITELN(Temp,nick' 'username'@'dyn' 6');Close(Temp);Address command 'C:Copy ram:Jlog s:Jlog';"RAW NOTICE" nick ":You are added at Level 6 (god) ! You appear to be the Bots";"RAW NOTICE" nick ":owner, have fun !";"RAW NOTICE" nick ":Use /msg "Mynick" Showcommands";MainStuff();End;End;FServAssign:;Address command 'c:requestchoice TeaBot "Please Select a File Serv Directory" Ok';Address command 'c:requestfile drawersonly title "Select your FSERV: dir" >ram:FServ';Open(FS,"Ram:FServ",R);Direct=ReadLn(FS);parse var direct '"'Thes'"';parse var thes Out'/';Close(FS);Address command 'Assign Fserv: "'Out'"';Open(FSS,'env:FServ',W);WriteLn(FSS,'"'out'"');'ECHO P='d2c(27)'b«TeaBot» Assign to FServ: made to 'out' and saved to Env:';Close(FSS);Address command 'Copy Env:FServ envarc:FServ';Close(FS);Return;MSGTest:;Address Command 'c:Wait 5';"GetUsers";Userie=Result
Do Number=1 to Words(Userie);SingleWord=Word(Userie,Number);If Left(Singleword,1)='@' Then Singleword=substr(Singleword,2,Length(Singleword));UserHost Singleword;THost=Result;Parse Var THost Host1'@'TheRest;If SubStr(Left(Host1,length(Host1)-(length(Host1)-1)),1)='~' Then Do;Host1=Substr(left(Host1,length(Host1)),2);THost=Host1'@'TheRest;End;Call Resol;If Found=1 Then "RAW NOTICE" Singleword ":-You have a message(s) use /Msg "Mynick" Msg to read it.";Call MSGCheck;End;Return;MSGCheck:;Open(ThisFile,"S:TeaMSG",r);Do Until eof(ThisFile);ProcessLine=ReadLN(ThisFile);Parse Var ProcessLine '@'Test;If Test~='' Then If Upper(ProcessLine)=Upper(NDyn) Then "RAW NOTICE" SingleWord ":-You have a message(s) use /Msg "MyNick" Msg to read it.";End;Close(thisfile);Return;ISON:;Userhost Nickomatic;THost=Result;If left(THost,1)='~' Then HTost=Substr(THost,2,Length(THost)-1);Call Resol;If Upper(Ndyn)=Upper(Reqhost) Then "RAW NOTICE" Nickomatic ":-A new message has been added to your mailbox, use /Msg "Mynick" Msg to read it."
Return;Resol:;aa=Right(THost,1);Parse Var Thost Username1'@';If pos(aa,'0123456789')=0 Then Parse Var THost '.'NDyn' ';Else Do;Parse Var THost Ag '.' Bg '.' Cg '.';NDyn=Ag'.'Bg'.'Cg;End;NDyn=Username1'@'NDyn;Return;FSERV:;bf="FServ:";basefilename="DH0:organiser/";welcome_message="-TeaBot internal FServ 1.03 by M.Rushton. Commands currently supported: CD, DIR, GET, MAKEDIR, LIST, LEAVE/QUIT, AVAIL";pattern="DH0:comms/irc/amirc/rexx/fservpattern";onick=strip(User);Nick=onick;IF bf~='' THEN basefilename=strip(bf);pragma('d',basefilename);basefilename=pragma('d');IF right(basefilename,1)~='/'&right(basefilename,1)~=':' THEN basefilename=basefilename'/';wfor='';'say /dcc chat 'onick;'say /msg 'onick' 'welcome_message;PRAGMA('d',basefilename);line='';StartTime=TIME(S)+300;DO FOREVER;IF TIME(S)>StartTime THEN DO;nick=arg(1);'say /dcc close chat 'onick;wait 8;'say /msg 'onick' Bye bye! Max Idle time. Closing DCC Chat connection.';exit;END;ret='';GETMYNICK;mynick=result;lline=line;DO WHILE lline=line;GETLASTLINE
line=result;END;PARSELINE line;nick=line.prefix;to=line.dest;PARSE VAR nick nick '!';call UPLOAD(line,nick,onick,pattern);PARSE VAR line ':'nick'!'cak' 'type' 'morejunk' 'evenmore':' txt;If Type~='DCCMSG' Then type=morejunk;PARSE UPPER VAR txt cmd rest;IF left(cmd,1)~=';' THEN DO;IF upper(nick)=upper(onick)&type='DCCMSG' THEN DO;StartTime=TIME(S)+300;SELECT;WHEN cmd='CD' THEN CALL CD(nick,rest,basefilename);WHEN cmd='DIR' THEN CALL DIR(nick,rest);WHEN cmd='LIST' THEN CALL LIS(nick,rest);WHEN cmd='SEND' THEN CALL SEND(nick,rest);WHEN cmd='GET' THEN CALL GET(nick,rest,basefilename);WHEN cmd='MAKEDIR'|cmd='MKDIR' THEN CALL MAKDIR(nick,rest);WHEN cmd='LEAVE'|cmd='QUIT' THEN call le(nick);WHEN cmd='AVAIL' THEN call info(nick,basefilename);WHEN cmd='I'|cmd='IGNORE' THEN NOP;WHEN cmd='Y'|cmd='YES' THEN NOP;WHEN cmd='N'|cmd='NO' THEN NOP;OTHERWISE 'say /msg 'nick' Sorry... Command:'cmd' is unknown';END;END;END;END;EXIT;CD: PROCEDURE;nick=ARG(1);rest=strip(ARG(2));bfname=strip(ARG(3));SELECT
WHEN left(rest,6)='FSERV:' THEN direct=bfname||SUBSTR(rest,7,length(rest)-6);WHEN index(rest,':')~=0 THEN DO;direct=PRAGMA('D');'say /msg 'nick' Sorry... You must stay within the confines of FSERV: ';END;OTHERWISE direct=rest;END;IF right(bfname,1)='/' THEN bfname=left(bfname,length(bfname)-1);PRAGMA('d',direct);IF rest='/'&length(pragma('d'))<length(bfname) THEN DO;'say /msg 'nick' Sorry... You must stay within the confines of FSERV: ';direct=bfname;END;dirname=PRAGMA('D');r=right(bfname,1);IF r~=':'&r~='/' THEN bfnamee=bfname'/';ELSE bfnamee=bfname;PARSE VAR dirname(bfnamee) dirname;IF STRIP(dirname)='' THEN pragma('d',bfname);'say /msg 'nick' FSERV:'dirname;RETURN;DIR: PROCEDURE;nick=ARG(1);rest=strip(ARG(2));bold='02'x;SELECT;WHEN left(rest,6)='FSERV:' THEN NOP;WHEN index(rest,'/')~=0|index(rest,':')~=0 THEN DO;rest='';'say /msg 'nick' -Sorry... You must stay within the confines of FSERV: ';END;OTHERWISE NOP;END;IF POS('INTER',upper(rest))~=0 THEN rest='';'say /msg 'nick' 'bold||'-Directory listing:'bold
address command 'dir 'rest' >pipe:dirlist';IF open(in,'pipe:dirlist') THEN DO;DO until eof(in);line=readln(in);IF pos(' (dir)',line)~=0 THEN DO;PARSE VAR line dirname ',' pw '(dir)';IF strip(pw)~='' THEN line=bold||dirname' (dir) PASSWORD PROTECTED'||bold;ELSE line=bold||line||bold;END;'say /msg 'nick' 'line;END;END;CLOSE(in);RETURN;GET: PROCEDURE;nick=STRIP(ARG(1));rest=STRIP(ARG(2));bfname=STRIP(ARG(3));sendspace='YES';IF rest='' THEN 'say /msg 'nick' Usage: GET <filename>';IF rest~='' THEN DO;IF left(rest,6)='FSERV:' THEN DO;parse var rest 'FSERV:' rest;rest=strip(bfname)||strip(rest);END;IF left(rest,6)~='FSERV:' THEN DO;rest=PRAGMA('d')'/'rest;END;IF ~exists(rest) THEN 'say /msg 'nick' -File not found....';IF exists(rest) THEN DO;IF index(rest,' ')~=0&UPPER(sendspace)='YES' THEN DO;fname=compress(PARSEFILENAME(rest));address command 'copy "'rest'" t:'fname;rest='t:'fname;END;'say /dcc send 'nick' 'rest;'say /msg 'nick' Attempting to send file now...';END;END;RETURN;MAKDIR: PROCEDURE;nick=STRIP(ARG(1))
rest=STRIP(ARG(2));bfname=STRIP(ARG(3));lrest=rest;IF rest='' THEN 'say /msg 'nick' -Usage: MAKEDIR <directory name>[,password]';IF rest~='' THEN DO;IF left(rest,6)='FSERV:' THEN DO;parse var rest 'FSERV:' rest;rest=strip(bfname)||strip(rest);END;IF left(rest,6)~='FSERV:' THEN DO;rest=PRAGMA('d')'/'rest;END;IF right(rest,1)='/' THEN rest=left(rest,length(rest)-1);IF exists(rest) THEN 'say /msg 'nick' Sorry.... 'lrest' already exists. Makedir failed';IF ~exists(rest) THEN DO;IF ~MAKEDIR(rest) THEN 'say /msg 'nick' Makedir failed for an unknown reason' ELSE 'say /msg 'nick' Directory 'lrest' created';END;RETURN;LIS: PROCEDURE;nick=ARG(1);rest=strip(ARG(2));bold='02'x;SELECT;WHEN left(rest,6)='FSERV:' THEN NOP;WHEN index(rest,'/')~=0|index(rest,':')~=0 THEN DO;rest='';'say /msg 'nick' -Sorry... You must stay within the confines of FSERV: ';END;OTHERWISE NOP;END;IF POS('INTER',upper(rest))~=0 THEN rest='';'say /msg 'nick' Directory listing:';address command 'list 'rest' >pipe:dirlist'
IF open(in,'pipe:dirlist') THEN DO;DO until eof(in);line=readln(in);IF pos('Dir',line)~=0 THEN DO;PARSE VAR line dirname ',' pw 'Dir' junk date;IF strip(pw)~='' THEN line=bold||dirname' PW PROTECTED Dir 'date||bold;ELSE DO;PARSE VAR line dirname 'Dir' junk date;line=bold||dirname' Dir'date||bold;END;END;IF pos('Dir',line)=0 THEN DO;PARSE VAR line filename size junk date;line=filename' 'size||date;END;'say /msg 'nick' 'line;END;CLOSE(in);RETURN;info: PROCEDURE;nick=strip(arg(1));bfname=strip(arg(2));address command 'info >pipe:info 'bfname;open(in,'pipe:info','r');DO n=1 to 4;line=readln(in);END;PARSE VAR line unit size used free full '%' junk;PARSE VAR size size 'M';size=size*1024;block_size=size/(free+used);free=block_size*free;used=block_size*used;IF free>1024 THEN DO;free=trunc(free/1024,1);free=free'Mb';END;ELSE free=trunc(free)'Kb';IF used>1024 THEN DO;used=trunc(used/1024,1);used=used'Mb';END;ELSE used=trunc(used)'Kb';'say /msg 'nick' Used:'used' Free:'strip(free)' Full:'full'% Left:'100-full'%'
CLOSE(in);RETURN;le: PROCEDURE;nick=arg(1);'say /msg 'nick' Bye bye! Closing DCC Chat connection.';'say /dcc close chat 'nick;exit;END;ParseFileName: procedure;parse arg FilePath,Part;DivPos=max(lastpos(':',FilePath),lastpos('/',FilePath))+1;if abbrev('FILE',upper(Part));then return substr(FilePath,DivPos);else;return strip(left(FilePath,DivPos-1),'T','/');UPLOAD: PROCEDURE;line=arg(1);nick=arg(2);onick=arg(3);pattern=arg(4);wfor='';ex='';type='';resp='Y';PARSE VAR line ':' morejunk ':' dcc send name junk;IF length(dcc)=4 THEN dcc=right(dcc,(length(dcc)-1));IF dcc='DCC'&send='SEND'&upper(nick)=upper(onick)&wfor='' THEN DO;suffix=UPPER(RIGHT(NAME,(LENGTH(NAME))-(LASTPOS('.',NAME))));dest=pragma('d');IF suffix~=''&open(in,pattern) THEN DO;DO UNTIL eof(in)|ex~='';suffix_data=readln(in);PARSE VAR suffix_data suf type ldest;IF right(ldest,1)='/'&length(ldest)~=0 THEN ldest=left(ldest,length(ldest)-1);IF strip(upper(suf))=upper(suffix) THEN ex=-1;END;CLOSE(IN);IF ex=-1 THEN DO
IF upper(type)='ASK' THEN resp=askusr(nick,onick,suffix,ldest);IF upper(type)='FORCE' THEN dest=ldest;END;END;IF ex~=-1 THEN ldest=dest;IF resp='Y' then dest=ldest;dest=strip(dest,'l');finame=dest'/'name;IF resp~='I' THEN DO;'say /dcc get 'nick' 'name' 'finame;IF type='ASK'|type='' THEN 'say /msg 'nick' -Now receiving 'name;IF type='FORCE' THEN 'say /msg 'nick' -Now forcing 'name' to 'ldest' because it has suffix 'suf;END;IF resp='I' THEN 'say /msg 'nick' -FSERV will ignore current DCC offer for 'PARSEFILENAME(name);END;RETURN;ASKUSR: PROCEDURE;nick=arg(1);onick=arg(2);suffix=arg(3);destination_path=arg(4);retval='';'say /msg 'nick' DCC send detected with suffix 'suffix'. Would you like me to move this to: 'destination_path'? (YES/NO/IGNORE)';DO until retval~='';lline=line;DO WHILE lline=line;GETLASTLINE;line=result;END;PARSELINE line;nick=line.prefix;to=line.dest;PARSE VAR nick nick '!';PARSE VAR line ':' nick '!' ' ' type ' ' morejunk ' ' ':' txt;type=morejunk;PARSE UPPER VAR txt cmd rest
IF left(cmd,1)~=';' THEN DO;IF upper(nick)=upper(onick)&type='DCCMSG' THEN DO;IF cmd='YES'|rest='Y' THEN retval='Y';IF cmd='NO'|rest='N' THEN retval='N';IF cmd='IGNORE'|rest='I' THEN retval='I';END;END;END;RETURN retval
/* Original script: 2601 lines, 80055 bytes, cmprate 21.3% */